package com.software.backend.searchmovie.service.repository;//package com.example.file_demo.repository;
//
//import com.example.file_demo.Utils.Constant;
//import com.example.file_demo.Utils.SearchMovieUtil;
//import com.example.file_demo.entity.Movie;
//import com.example.file_demo.entity.Video;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @program: File_demo
// * @description:
// * @author: C@t
// * @create: 2022-11-10 09:24
// **/
//public class MovieRepositoryImpl implements MovieRepository {
//    @Override
//    public List<Movie> selectMovies(String content) {
//        List<Movie> movieList = new ArrayList<>();
//        String path = this.getClass().getResource(Constant.MOVIE_DIR_PATH).getPath();
////        System.out.println(path);
//        try {
//            List<String> fileNames = SearchMovieUtil.scanAllFileFromDir(path);
//            for (String fileName : fileNames) {
//            List<Video> videoList  =SearchMovieUtil.scanFile(path + "\\" +fileName, content);
//                String[] file = fileName.split(".");
//                String movieName = file[0];
//                //通过电影名字返回Movie,添加到MovieList，然后赋值id给这批Video
//
//                for(Video video:videoList){
//                    video.setMovieId(1);//这个位置写电影的Id
//                }
//            }
//        } catch (Exception e) {
//            throw new RuntimeException(e);
//        }
//        return movieList;
//    }
//
//    @Override
//    public List<Movie> findMovieByName(String name) {
//        return null;
//    }
//
//}